package com.leadingsoft.pwxk.enums;

import java.util.List;

import com.alibaba.fastjson.TypeReference;
import com.leadingsoft.pwxk.model.*;

/**
 *
 * @author ysh desc 接口信息枚举
 */
public enum InterfaceEnum {
//	发证企业摘要信息
	EPS_Message(
			"getMessage",
			"发证企业摘要信息",
			new TypeReference<List<Summary>>() {
			}),
	EPS_REGISTER(
			"getTab1",
			"获取企业注册信息",
			new TypeReference<List<BaseInfo>>() {
			}),
	EPS(
			"getTab2",
			"获取排污单位基本信息",
			new PwBaseInfo()),
	PRODUCT_CAPACITY(
			"getTab3",
			"取主要产品及产能信息",
			new Product()),
	MATERIAL_FUEL_INFO(
			"getTab4",
			"获取主要原辅材料及燃料信息",
			new ProductMaterial()),
	EPS_NODE_FAC(
			"getTab5",
			"获取排污节点及污染治理设施信息",
			new DrainMana()),
	AIR_EMISSIONS_INFO(
			"getTab6",
			"获取大气污染物排放信息-排放口信息",
			new AirPollution()),
	AIR_ORG_EMISSIONS(
			"getTab7",
			"获取大气污染物排放信息-有组织排放信息",
			new AirPollutionOrg()),
	AIR_OORG_EMISSIONS(
			"getTab8",
			"获取大气污染物排放信息-无组织排放信息",
			new AirPollutionNoOrg()),
	EPS_AIR_INFO(
			"getTab9",
			"获取大气污染物排放信息-企业大气排放总许可量信息",
			new AirPermitInfo()),
	WATER_EMISSIONS(
			"getTab10",
			"获取水污染物排放信息-排放口信息",
			new WaterDrain()),
	WATER_APPLY(
			"getTab11",
			"获取水污染物排放信息-申请排放信息",
			new WaterDrainApply()),
	SELF_MONITOR(
			"getTab12",
			"获取环境管理要求-自行监测要求信息",
			new ManaSelf()),
	RECORD(
			"getTab13",
			"获取环境管理要求-环境管理台账记录要求信息",
			new TypeReference<List<ManaRecordInfo>>() {
			}),
	ADD(
			"getTab14",
			"获取地方环保部门依法增加的内容信息",
			new ManaLocal()),
	FILE(
			"getTab15",
			"获取相关附件（包括许可证申请表）信息",
			new TypeReference<List<FileDetail>>() {
			}),
	COMPARISON_TABLE(
			"getTab16",
			"获取发证后-许可证正本、副本、编码对照表信息",
			new TypeReference<List<FileDetail>>() {
			}),
	LICENSE(
			"getTab17",
			"获取发证后-许可证发证信息",
			new LicenseInfo()),
	BASIC_AUDIT(
			"getTab18",
			"审批信息-基本信息审核",
			new AuditBaseInfo()),
	AIR_EMISSIONS_AUDIT(
			"getTab19",
			"审批信息-大气污染物排放信息审核",
			new AuditAirPollutionEmissions()),
	WATER_EMISSIONS_AUDIT(
			"getTab20",
			"审批信息-水污染物排放信息审核",
			new AuditWaterEmissions()),
	SELF_MONITOR_AUDIT(
			"getTab21",
			"审批信息-自行监测要求",
			new AuditSelfMonitor()),
	REPORT(
			"getTab22",
			"审批信息-执行（守法）报告要求",
			new TypeReference<List<AuditPerformReport>>() {
			}),
	PUBLIC(
			"getTab23",
			"审批信息-信息公开要求",
			new TypeReference<List<AuditPublicInfo>>() {
			}),
	RECORD_AUDIT(
			"getTab24",
			"审批信息-环境管理台账记录要求",
			new TypeReference<List<TZRecord>>() {
			}),
	OTH_CON_AUDIT(
			"getTab25",
			"审批信息-其他控制管理要求及许可内容",
			new OtherController()),
	CERT_AUDIT(
			"getTab26",
			"审批信息-发证信息",
			new AuditCert()),
	FILE_AUDIT(
			"getTab27",
			"审批信息-相关附件",
			new TypeReference<List<FileDetail>>() {
			}),
	POLLUTIONS(
			"getBollutants",
			"污染物信息",
			new TypeReference<List<Pollutions>>() {
			}),

	REGION_CODE(
			"getRegionCode",
			"行政区划",
			new TypeReference<List<RegionCode>>() {
			}),
	SCSSFU_INFO(
			"getProductDeviceInfo",
			"生产设施附录信息",
			new TypeReference<List<FacilityAppendix>>() {
			}),
	GYLCT(
			"getSHFiles",
			"废气污染治理设施附录-简易工艺流程图",
			new TypeReference<List<ProcessChart>>() {
			}),
	AUDIT_INFO(
			"getAuditInfo",
			"审批消息",
			new TypeReference<List<AuditMessages>>() {
			}),
	UNDO_INFO(
			"getUndoInfo",
			"撤销、注销企业信息",
			new TypeReference<List<UndoBaseInfo>>() {
			}),
	LIC_AIC(
			"getLicArc",
			"许可证库发证数据摘要信息",
			new TypeReference<List<LicArc>>(){}
	);

	private String name;
	private String desc;
	private Object obj;

	/**
	 *
	 * @param name
	 *            接口地址
	 * @param desc
	 *            接口描述
	 * @param o
	 *            根据接口文档 返回对象就创建对应实体 返回数组就创建对应的TypeReference对象
	 */
	InterfaceEnum(String name, String desc, Object o) {
		this.name = name;
		this.desc = desc;
		this.setObj(o);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static InterfaceEnum get(int order) {
		for (InterfaceEnum e : InterfaceEnum.values()) {
			if (e.ordinal() == order) {
				return e;
			}
		}
		return null;
	}

	public static InterfaceEnum get(InterfaceEnum epsRegister) {
		return epsRegister;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

}
